<script src="jquery-2.1.1.min.js"></script>
<script>
  function showDevices(devs){
    console.log(devs);
    for(dev in devs){
      $("#device-select").append($('<option value='+dev+'>'+devs[dev]+'</option>'));
    }
  }
  function rec(){
    js2Qt.startRecord($("#device-select").val())
  }
  function stop(){
    js2Qt.stopRecord();
  }
  function log(data){
	$('.msg-ct').append($("<div>"+data+"</div>"));
  };
  function recordStatus(s){
	if(s==0){
		$("#record-stop").removeAttr("disabled");
		$("#record-start").attr("disabled", "disabled");
		$("#device-select").attr("disabled", "disabled");
		$("#led").attr("src", "img/red_led.png")
		
	}else if(s==2){
		$("#record-start").removeAttr("disabled");
		$("#record-stop").attr("disabled", "disabled");
		$("#device-select").removeAttr("disabled");
		$("#led").attr("src", "img/green_led.png")
	}else{
		$("button").attr("disabled", "disabled");
		$("#device-select").attr("disabled", "disabled");
		$("#led").attr("src", "img/gray_led.png")
	}
  }
</script>
<html>
<body>
 <div class=device-select-ct> 	
  <select id=device-select disabled>
  </select>
  <img id=led src="img/gray_led.png" width=30>
 </div>
 <div class=record-btn-ct> 	
  <button id=record-start onclick="rec();" disabled>Start record</button>
  <button id=record-stop onclick="stop();" disabled>Stop record</button>
 </div>
 <div class=msg-ct />
</body>
</html>
